/**
 * Copyright (c) 2020-2024, huli.com
 * All rights reserved.
 */
package com.xiaohujr.xuexue.threadpool;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author Xue Xue (xuexue1@huli.com)
 * @version 1.0
 * @since 2021/3/4
 */
public class ThreadPoolTest {
    private static AtomicInteger count = new AtomicInteger(0);
    public static void main(String[] args) {

        ThreadPoolExecutor executor = new ThreadPoolExecutor(10,
                20,
                1,
                TimeUnit.SECONDS,
                new LinkedBlockingDeque<>(10),
                r -> new Thread(r,String.valueOf(count.addAndGet(1))),
                new ThreadPoolExecutor.AbortPolicy());
    }

}
